package operation;

import book.BookList;

import java.util.Scanner;

public class FindOperation implements IOPeration {
    @Override
    public void work(BookList bookList) {
        System.out.println("查找图书");
        Scanner in = new Scanner(System.in);
        System.out.println("请输入图书名称");
        String name = in.nextLine();
        for (int i = 0; i < bookList.getUseSize(); i++) {
            if(bookList.getBook(i).getName().equals(name)) {
                System.out.println(bookList.getBook(i));
                return;
            }
        }
        System.out.println("未找到这一步书");
    }
}
